﻿using System;
using System.ComponentModel;
using System.Runtime.InteropServices;
using Teigha.Core;

namespace Teigha.TD
{
	public class OdDbHardPointerId : OdDbObjectId
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public OdDbHardPointerId(IntPtr cPtr, bool cMemoryOwn) : base(TD_DbPINVOKE.OdDbHardPointerId_SWIGUpcast(cPtr), cMemoryOwn)
		{
			this.swigCPtr = new HandleRef(this, cPtr);
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		public static HandleRef getCPtr(OdDbHardPointerId obj)
		{
			if (obj != null)
			{
				return obj.swigCPtr;
			}
			return new HandleRef(null, IntPtr.Zero);
		}

		~OdDbHardPointerId()
		{
			this.Dispose();
		}

		public override void Dispose()
		{
			if (this.swigCPtr.Handle != IntPtr.Zero)
			{
				if (this.swigCMemOwn)
				{
					lock (this.locker)
					{
						if (this.swigCPtr.Handle != IntPtr.Zero && this.swigCMemOwn)
						{
							this.swigCMemOwn = false;
							TD_DbPINVOKE.delete_OdDbHardPointerId(this.swigCPtr);
						}
					}
					this.swigCMemOwn = false;
				}
				this.swigCPtr = new HandleRef(null, IntPtr.Zero);
			}
			GC.SuppressFinalize(this);
			base.Dispose();
		}

		public OdDbHardPointerId() : this(TD_DbPINVOKE.new_OdDbHardPointerId__SWIG_0(), true)
		{
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdDbHardPointerId(OdDbObjectId objectId) : this(TD_DbPINVOKE.new_OdDbHardPointerId__SWIG_1(OdDbObjectId.getCPtr(objectId)), true)
		{
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdDbHardPointerId(OdDbStub objectId) : this(TD_DbPINVOKE.new_OdDbHardPointerId__SWIG_2(OdDbStub.getCPtr(objectId)), true)
		{
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdDbHardPointerId Assign(OdDbHardPointerId objectId)
		{
			OdDbHardPointerId result = new OdDbHardPointerId(TD_DbPINVOKE.OdDbHardPointerId_Assign__SWIG_0(this.swigCPtr, OdDbHardPointerId.getCPtr(objectId)), false);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdDbHardPointerId Assign(OdDbObjectId objectId)
		{
			OdDbHardPointerId result = new OdDbHardPointerId(TD_DbPINVOKE.OdDbHardPointerId_Assign__SWIG_1(this.swigCPtr, OdDbObjectId.getCPtr(objectId)), false);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new OdDbHardPointerId Assign(OdDbStub objectId)
		{
			OdDbHardPointerId result = new OdDbHardPointerId(TD_DbPINVOKE.OdDbHardPointerId_Assign__SWIG_2(this.swigCPtr, OdDbStub.getCPtr(objectId)), false);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new bool IsNotEqual(OdDbObjectId objectId)
		{
			bool result = TD_DbPINVOKE.OdDbHardPointerId_IsNotEqual__SWIG_0(this.swigCPtr, OdDbObjectId.getCPtr(objectId));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool IsNotEqual(OdDbStub objectId)
		{
			bool result = TD_DbPINVOKE.OdDbHardPointerId_IsNotEqual__SWIG_1(this.swigCPtr, OdDbStub.getCPtr(objectId));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new bool IsEqual(OdDbObjectId objectId)
		{
			bool result = TD_DbPINVOKE.OdDbHardPointerId_IsEqual__SWIG_0(this.swigCPtr, OdDbObjectId.getCPtr(objectId));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool IsEqual(OdDbStub objectId)
		{
			bool result = TD_DbPINVOKE.OdDbHardPointerId_IsEqual__SWIG_1(this.swigCPtr, OdDbStub.getCPtr(objectId));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		private object locker = new object();

		private HandleRef swigCPtr;
	}
}
